package com.yonyou.cyxdms.basedata.service.service.model;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yonyou.cyxdms.basedata.client.domains.vo.ModelCacheVO;
import com.yonyou.cyxdms.basedata.service.dto.vehiclemodel.*;
import com.yonyou.cyxdms.basedata.service.entity.model.ModelPO;
import com.yonyou.cyxdms.basedata.service.vo.CarparamInfoVO;
import com.yonyou.cyxdms.basedata.service.vo.GroupCarparamInVO;
import com.yonyou.cyxdms.basedata.service.vo.VsProductDlrVO;
import com.yonyou.cyxdms.basedata.service.vo.model.GmsModelVO;
import com.yonyou.cyxdms.basedata.service.vo.model.ModelDictVO;
import com.yonyou.cyxdms.basedata.service.vo.model.VehicleProductModelVO;
import com.yonyou.cyxdms.basedata.service.vo.packages.PackageDictVO;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 车型
 *
 * @author renwd
 * @since 2018/12/11
 */
public interface ModelService {

    /**
     * 根据条件查询车型信息
     *
     * @param queryParam
     * @return java.util.List<ModelCacheVO>
     * @author renwd
     * @since 2019/1/9
     */
    List<ModelCacheVO> queryModelByCondition(Map<String, Object> queryParam);

    /**
     * 根据车系id查询车型信息
     *
     * @param seriesId
     * @return java.util.List<com.yonyou.cyxdms.basedata.client.domains.DTO.basedata.ModelCacheVO>
     * @author guorp
     * @since 2018/12/13
     */
    List<ModelCacheVO> getModelBySeriesId(Long seriesId);

    List<ModelCacheVO> allModel();

    /**
     * 查询车型分页信息
     *
     * @author dengqiang
     * @since 2019/1/7
     */
    public IPage<CarparamInfoVO> queryCarparamInfo(Long brandId, Long carserialId, Long pageNum, Long pageSize);

    /**
     * 根据车系ID列表查询车型信息
     *
     * @author dengqiang
     * @since 2019/1/7
     */
    public List<GroupCarparamInVO> queryCarparamInfo(Long carserialId);

    /**
     * 查询车型信息（pc）
     *
     * @param page
     * @param modelQueryDTO
     * @author Tansj
     * @since 2019/11/15
     */
    IPage<VehicleProductModelVO> queryVehicleProductModel(Page page, ModelQueryDTO modelQueryDTO);

    /**
     * dcs查询车型信息
     *
     * @param page
     * @param queryParam
     * @return com.baomidou.mybatisplus.core.metadata.IPage<com.yonyou.cyxdms.basedata.service.vo.model.VehicleProductModelVO>
     * @author renwd
     * @since 2019/7/18
     */
    IPage<GmsModelVO> queryVehicleProductDcsModel(Page page, Map<String, Object> queryParam);

    /**
     * 新增车型
     *
     * @param modelDTO
     * @return java.lang.Integer
     * @author renwd
     * @since 2019/7/11
     */
    Integer addModel(ModelModifyDTO modelDTO);

    /**
     * 新增车型
     *
     * @param modelDTO
     * @return java.lang.Integer
     * @author renwd
     * @since 2019/7/11
     */
    Integer addDcsModel(ModelModifyDTO modelDTO);

    /**
     * 修改车型
     *
     * @param id
     * @param modelDto
     * @return void
     * @author renwd
     * @since 2019/7/16
     */
    Integer modifyModel(Long id, ModelModifyDTO modelDto);

    /**
     * 修改车型
     *
     * @param id
     * @param modelDto
     * @return void
     * @author renwd
     * @since 2019/7/16
     */
    Integer modifyDcsModel(Long id, ModelModifyDTO modelDto);

    /**
     * 车型导出excel
     *
     * @param queryParam
     * @param request
     * @param response
     * @return void
     * @author renwd
     * @since 2019/7/15
     */
    void exportExcelForModel(Map<String, Object> queryParam, HttpServletRequest request, HttpServletResponse response);

    /**
     * 车型下拉框
     *
     * @param queryParam
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.vo.model.ModelDictVO>
     * @author renwd
     * @since 2019/7/16
     */
    List<ModelDictVO> queryModelDict(Map<String, Object> queryParam);

    /**
     * dms端 查询集团端
     *
     * @param queryParam
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.vo.model.GmsModelVO>
     * @author renwd
     * @since 2019/7/18
     */
    List<GmsModelVO> queryGmsModel(Map<String, Object> queryParam);

    /**
     * 导入车型
     *
     * @param importFile
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.dto.vehiclemodel.ModelImportDTO>
     * @author renwd
     * @since 2019/7/22
     */
    List<ModelImportDTO> importModel(MultipartFile importFile);

    /**
     * 车型是否存在
     *
     * @param modelName
     * @return com.yonyou.cyxdms.basedata.service.entity.model.ModelPO
     * @author renwd
     * @since 2019/7/22
     */
    ModelPO existsSeries(String modelName);

    /**
     * @Description: 根据Code获取车型
     * @Param: [seriesId, appId, modelCode]
     * @Return: com.yonyou.cyxdms.basedata.service.vo.model.ModelDictVO
     * @Author: lijun
     * @Date: 16:05 2019/8/22
     **/
    ModelDictVO getByCode(String appId, Long seriesId, String modelCode);

    Long queryModelBynameAndAppid(String appId, String modelName);

    List<Map<String, Object>> queryModelMapping(String appId);

    Map<Object, Object> getAllByAppId(String appId, String requestId, Long recordTime);

    void addModelGeneral(List<GeneralModelDTO> generalModelDto);

    List<ModelCacheVO> getAllModelByAppId(String appId);

    /**
     * 品系型查询界面车型下拉框
     *
     * @param brandsId
     * @param seriesId
     * @author Tansj
     * @since 2019/11/18
     */
    List<ModelDictVO> queryModelDictAll(String brandsId, String seriesId);

    /**
     * 品系型查询界面车型下拉框
     *
     * @param brandsId
     * @param seriesId
     * @author Tansj
     * @since 2019/11/18
     */
    List<ModelDictVO> queryDcsModelDictAll(String brandsId, String seriesId);

    /**
     * 根据经销商授权显示车型
     *
     * @param  queryParam 显示的车型对象map格式
     * @author wangsht
     * @since 2020-12-17
     */
    List<ModelDictVO> queryDcsModelDictAll(Map<String, Object>  queryParam);


    /**
     * 新增编辑界面本店面车型下拉框
     *
     * @param brandsId
     * @param seriesId
     * @author Tansj
     * @since 2019/11/18
     */
    List<ModelDictVO> queryModelDictOwner(String brandsId, String seriesId);
    
    /**
     * 新增编辑界面本店面配置下拉框
     *
     * @param brandsId
     * @param seriesId
     * @param modelId
     * @author zhangys
     * @since 2020/2/25
     */
    List<PackageDictVO> queryPackageDictOwner(String brandsId, String seriesId,String modelId);

    /**
     * 新增编辑界面本店面车型下拉框
     *
     * @param brandsId
     * @param seriesId
     * @author Tansj
     * @since 2019/11/18
     */
    List<ModelDictVO> queryDcsModelDictOwner(String brandsId, String seriesId);

    /**
     * 根据查询条件返回对应的车型数据
     *
     * @param modelQueryDTO
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.vo.model.VehicleProductModelVO>
     * @author caozx
     * @since 2020/12/8
     */
    List<VehicleProductModelVO> queryVehicleProductModel(ModelQueryDTO modelQueryDTO);


    VsProductDlrVO getModelNew(String modelCode,String appId);

    ArrayList<ModelDictVO> queryModelDictAll();

    List<SeriesModelTreeDto> getSeriesModelTree();
}
